// var url_service = "localhost:9555";
var url_service = "http://124.222.147.63:9555";

function login() {
    var userName = $("#userName").val();
    var password = $("#uPassword").val();
    $.ajax({
        type: 'POST',
        url: url_service + '/api/xchat/checkuser?account=' + userName + '&password=' + password,
        dataType: 'json',
        success: function (res) {
            if (res.success){
                window.location.href = './myxchat.html?userId='+res.data.id + '&sessionId=cad8518d83cb46c8aaf444a4f055864b';
            }
        }
    })
}

document.onkeydown = function (e) {
    var keycode = document.all ? event.keyCode : e.which;
    if (keycode == 13) {
        login();
    }
}